/*
 * @Description: 系统设置 - 排序设置
 * @Author: Rfan
 * @Date: 2022-02-11 11:00:44
 * @LastEditTime: 2022-12-30 14:56:29
 */

import classNames from 'classnames/bind';
import { SortingRouterTypeContext } from './contexts/SortingRouterTypeContext';
import { SortContextProvider } from './contexts/SortContext';
import NavSidebar from './components/NavSidebar';
import List from './components/List';
import PageLayout from '@/layout/PageLayout';
import { EnumSortingRouteTypes } from './dictionaries';
import styles from './styles/sorting.module.scss';

const cx = classNames.bind(styles);

interface ISystemSortingProps {
  routerType?: EnumSortingRouteTypes;
}

export const SystemSortingPage = (props: ISystemSortingProps) => {
  const { routerType = EnumSortingRouteTypes.Normal } = props;

  return (
    <SortingRouterTypeContext.Provider value={{ routerType }}>
      <SortContextProvider>
        <PageLayout className={cx('sorting-wrap')} sidebar={<NavSidebar />}>
          <List />
        </PageLayout>
      </SortContextProvider>
    </SortingRouterTypeContext.Provider>
  );
};

const SystemSorting = () => <SystemSortingPage />;

export default SystemSorting;
